import { createBrowserRouter, createRoutesFromElements,Route } from 'react-router-dom';

import { Layout } from '@/layout';

const routes = createRoutesFromElements(
  <Route>
    <Route path="/login" element={<div>login</div>} />
    <Route path="/403" lazy={() => import('@/views/403')} />
    {/* errorElement={<ErrorPage />} */}
    <Route path="/" element={<Layout />}>
      <Route path="flow" index lazy={() => import('@/views/flow')} />
      <Route path="api" lazy={() => import('@/views/api')} />
      <Route path="*" element={<div className="text-center py-24">404</div>} />
    </Route>
  </Route>
);

export const router: any = createBrowserRouter(routes, { basename: '' });
